package com.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.study.ExcludeFromComponentScan;

/**
 * 方式一:MyRibbonConfig.class与@ComponentScan不在同一个包下
 * 
 * 方式二:自定义不扫描的注解
 * @ComponentScan(excludeFilters = {@ComponentScan.Filter(type=FilterType.ANNOTATION, value=ExcludeFromComponentScan.class)})
 *
 */
@Configuration
@ExcludeFromComponentScan
public class MyRibbonConfig {
	
	@Bean
	public IRule ribbonRule() {
		return new RandomRule();
	}

}
